package com.demo.inheritance.tableperclasshierarcy;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name="REMOTE_USER_DETAILS")
/*@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="TYPE" ,discriminatorType=DiscriminatorType.CHAR)
@DiscriminatorValue(value="R")*/
@Inheritance(strategy=InheritanceType.JOINED)
public class RemoteUserDetailsDTO {

	private int userId;
	private String username;
	private boolean locked;
	private Timestamp createdTime;
	private String fullName;
       
	@Id
	@Column(name = "USER_ID")
	@GeneratedValue(strategy = GenerationType.AUTO) //TABLE is used in case of TABLE_PER_CLASS
	public int getUserId() {
		return userId;
	}

	@Column(name = "USER_NAME")
	public String getUsername() {
		return username;
	}

	@Column(name = "IS_LOCKED")
	public boolean isLocked() {
		return locked;
	}

	@Column(name = "CREATED_TIME")
	public Timestamp getCreatedTime() {
		return createdTime;
	}

	@Column(name = "FULL_NAME")
	public String getFullName() {
		return fullName;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	public void setCreatedTime(Timestamp createdTime) {
		this.createdTime = createdTime;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

}
